import request from '@/utils/request'
// 获取人员列表
export const getPersonnel = (id, userName) => {
  return request({
    method: 'GET',
    url: `api/user-service/user/search?pageIndex=${id}&pageSize=10`,
    params: {
      userName
    }
  })
}
// 人员新建
export const Personneladd = (data) => {
  return request({
    method: 'post',
    url: 'api/user-service/user',
    data
  })
}
// 获取修改角色列表
export const getrole = () => {
  return request({
    method: 'GET',
    url: 'api/user-service/role'
  })
}
// 修改人员
export const changepeople = (id, data) => {
  return request({
    method: 'put',
    url: `api/user-service/user/${id}`,
    data
  })
}
// 获取区域列表
export const getlist = () => {
  return request({
    method: 'GET',
    url: 'api/vm-service/region/search?pageIndex=1&pageSize=100000'
  })
}
// 删除人员
export const delpeople = (id) => {
  return request({
    method: 'DELETE',
    url: `/api/user-service/user/${id}`
  })
}
// 人员工作量列表
export const workloadlist = (id, params) => {
  return request({
    method: 'GET',
    url: `api/user-service/user/searchUserWork?pageIndex=${id}&pageSize=10`,
    params
  })
}
// 获取用户基本信息 弹出框头部
export const basicinformation = (id) => {
  return request({
    method: 'GET',
    url: `api/user-service/user/${id}`
  })
}
// 获取用户工作量 弹出框下面表格
export const workstatistics = (userId, start, end) => {
  return request({
    method: 'GET',
    url: `api/task-service/task/userWork?userId=${userId}&start=${start}&end=${end}`
  })
}
// 第三个页面 获取上面两个图片信息
export const gettoptwo = (start, end) => {
  return request({
    method: 'GET',
    url: `api/task-service/task/taskReportInfo/${start}/${end}`
  })
}
// 拿下拉框数据
export const getxialalist = () => {
  return request({
    method: 'GET',
    url: 'api/vm-service/region/search?pageIndex=1&pageSize=100000'
  })
}
// 工单状态图
export const getgdztt = (star, end) => {
  return request({
    method: 'GET',
    url: `api/task-service/task/collectReport/${star}/${end}`
  })
}
